import request from '@/utils/request'

export function getListPage(params) {
    return request({
      url: '/operate/firstpageRecommends/list',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8',
        'pageNum': params.pageNum,
        'pageSize': params.pageSize
      },
      method: 'get',
      params: params
    })
  }
  export function delRecommend(rowId) {
    return request({
        url: '/operate/firstpageRecommends/delete/'+rowId,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        },
        method: 'delete',
    })
  }
  export function addImg(data) {
    return request({
      url: '/ids/pub/file/uploadFile',
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      method: 'post',
      data
    })
  }
  export function getAllProInfo() {
    return request({
      url: '/operate/proInfos/Commodity',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'post',
    })
  }
  
  export function updateRecommend(data) {
    return request({
      url: '/operate/firstpageRecommends/update',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'put',
      data
    })
  }
  export function addRecommend(data) {
    return request({
      url: '/operate/firstpageRecommends/save',
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      },
      method: 'post',
      data
    })
  }